package erfgame.core;

public enum CompassDirection {
	
	north(4), 
	northEast(0), 
	east(5), 
	southEast(1),
	south(6), 
	southWest(2), 
	west(7), 
	northWest(3);
	
	public static final int ORDINAL_NORTH = 0;
	public static final int ORDINAL_NORTH_EAST = 1;
	public static final int ORDINAL_EAST = 2;
	public static final int ORDINAL_SOUTH_EAST = 3;
	public static final int ORDINAL_SOUTH = 4;
	public static final int ORDINAL_SOUTH_WEST = 5;
	public static final int ORDINAL_WEST = 6;
	public static final int ORDINAL_NORTH_WEST = 7;
	
	private int arrayIndex;
	
	CompassDirection( int arrayIndex ) {
		this.arrayIndex = arrayIndex;
	}
	
	/**
	 * A number for indexing into arrays based on compass direction (oblique directions are first)
	 * @return the array index
	 */
	public int getArrayIndex() {
		return this.arrayIndex;
	}
}
